package com.hidt.shop.controller;

import com.hidt.shop.domain.Evaluate;
import com.hidt.shop.service.EvaluateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@Controller
public class EvaluateController {

    @Autowired
    private  EvaluateService evaluateService;

    @RequestMapping(value = "/add_evaluate", method = {RequestMethod.POST})
    @ResponseBody
    public  int add_evlauate (@RequestBody Map<String,String> map){
        int i = evaluateService.add_evaluate(map);
        return i;
    }


    @RequestMapping(value = "/update_evaluate", method = {RequestMethod.POST})
    @ResponseBody
    public  int update_evlauate (@RequestBody Map<String,String> map){
        int i = evaluateService.update_evaluate(map);
        return i;
    }

    @RequestMapping(value = "/select_evaluate", method = {RequestMethod.POST})
    @ResponseBody
    public  List<Evaluate> select_evlauate (@RequestBody Map<String,String> map){
        List<Evaluate> evaluateList = evaluateService.select_evaluate(map);
        return evaluateList;
    }
}
